/***********************************************************
* 
*     File Name:  stringsize.cpp
* 
*        Author:  Algolc
* 
*          mail:  17360224@qq.com
* 
*  Created Time:  Tue 10 Jul 2018 10:10:12 AM CST
* 
***********************************************************/

#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string.h>

using namespace std;
int main() {
    char* buf_1 = "hi, man ";
    std::string buf_2 = "hi, man ";
    char buf_3[20] = "hi, man ";

    cout << "sizeof " << "strlen " << "size\n";
    cout << sizeof(buf_1) << " " << strlen(buf_1) << endl;
    cout << sizeof(buf_2.c_str())  << " " << strlen(buf_2.c_str())  << " " << buf_2.size() <<endl;
    cout << sizeof(buf_3) << " " << strlen(buf_3) << endl;
}
